package com.tiancheng.trade.authserver.enums;

import com.tiancheng.trade.commom.core.enums.BaseEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Optional;

/**
 * @Author: likailun
 * @Description: 用户注册类型
 * @Date: create in 2024/10/22 14:31
 */
@Getter
@AllArgsConstructor
public enum SignUpTypeEnum implements BaseEnum<Integer> {
    app_code(1, "app端手机号注册"),
    web_user(2, "web端用户名注册");

    private Integer code;
    private String desc;

    public static Optional<SignUpTypeEnum> getByCode(Integer code) {
        return Arrays.stream(SignUpTypeEnum.values()).filter(s -> s.getCode().equals(code)).findFirst();
    }
}
